using System;
using System.Collections.Generic;
using System.Text;

namespace TidhiGanitam.DataModel
{
    public class DurmuhurtamuDetails
    {
        Rasi m_StartTime;
        Rasi m_DurmuhurtamuSpan;
        Rasi m_EndTime;
        Rasi m_StartTimeHrs;
        Rasi m_EndTimeHrs;
        Rasi m_SpanTimeHrs;
        Enums.DurmuhurtamuSamayamu m_DurmuhurtamuSamayamu;
        public Rasi StartTime
        {
            get
            { return m_StartTime; }
            set
            { m_StartTime = value; }
        }
        public Rasi EndTime
        {
            get
            { return m_EndTime; }
            set
            { m_EndTime = value; }
        }
        public Rasi DurmuhurtamuSpan
        {
            get
            { return m_DurmuhurtamuSpan; }
            set
            { m_DurmuhurtamuSpan = value; }
        }
        public Rasi DurmuhurtamuSpanInHours
        {
            get
            { return m_SpanTimeHrs; }
            set
            { m_SpanTimeHrs = value; }
        }
        public Rasi StartTimeInHours
        {
            get
            { return m_StartTimeHrs; }
            set
            { m_StartTimeHrs = value; }
        }
        public Rasi EndTimeInHours
        {
            get
            { return m_EndTimeHrs; }
            set
            { m_EndTimeHrs = value; }
        }
        public Enums.DurmuhurtamuSamayamu DurmuhurtaSamayamu
        {
            get
            { return m_DurmuhurtamuSamayamu; }
            set
            { m_DurmuhurtamuSamayamu = value; }
        }
        public DurmuhurtamuDetails()
        {
            m_StartTime = new Rasi();
            m_DurmuhurtamuSpan = new Rasi();
            m_EndTime = new Rasi();
            m_StartTimeHrs = new Rasi();
            m_EndTimeHrs = new Rasi();
            m_SpanTimeHrs = new Rasi();
            m_DurmuhurtamuSamayamu = Enums.DurmuhurtamuSamayamu.Udayamu;
        }
        public static string GetShortDurmuhurtaSamyamu(Enums.DurmuhurtamuSamayamu samayamu)
        {
            string retString = string.Empty;
            switch (samayamu)
            {
                case Enums.DurmuhurtamuSamayamu.Madhyahnamu:
                    retString = "Ma_Du";
                    break;
                case Enums.DurmuhurtamuSamayamu.Ratri:
                    retString = "Ra_Du";
                    break;
                case Enums.DurmuhurtamuSamayamu.Sayantramu:
                    retString = "Sa_Du";
                    break;
                case Enums.DurmuhurtamuSamayamu.Udayamu:
                    retString = "U_Du";
                    break;
            }
            return retString;
        }

        public string GetDurmuhurtamuDetailsString()
        {
            string retString = string.Empty;
            retString = string.Format("{0} {1} to {2}",
                DurmuhurtamuDetails.GetShortDurmuhurtaSamyamu(m_DurmuhurtamuSamayamu),
                StartTimeInHours.DisplayFormat(Enums.DisplayFormat.HMS12),
                EndTimeInHours.DisplayFormat(Enums.DisplayFormat.HMS12));
            return retString;
        }
    }
}
